package com.one.efaimaly.user;

import android.content.Context;
import android.view.View;

import com.one.common.model.bean.CityBean;
import com.one.common.view.addresspick.AddressSelector;
import com.one.common.view.addresspick.OnItemClickListener;
import com.one.common.view.dialog.BaseDialog;
import com.one.efaimaly.R;

import java.util.ArrayList;

/**
 * creator: zhulunjun
 * time:    2018/8/7
 * describe:
 */
public class SelectCityDialog extends BaseDialog implements View.OnClickListener{
    private AddressSelector selector;
    public SelectCityDialog(Context context) {
        super(context, R.layout.dialog_select_city);
    }

    @Override
    public void initView() {
        super.initView();
        setShowBottom();
        selector = view.findViewById(R.id.as_city);
        view.findViewById(R.id.iv_cancel).setOnClickListener(this);
    }

    public void setOnTabSelectedListener(AddressSelector.OnTabSelectedListener onTabSelectedListener){
        selector.setOnTabSelectedListener(onTabSelectedListener);
    }

    public void setOnItemClickListener(OnItemClickListener onItemClickListener){
        selector.setOnItemClickListener(onItemClickListener);
    }

    public void setCitys(ArrayList<CityBean> citys){
        selector.setCities(citys);
    }


    @Override
    public void onClick(View view) {
        dismiss();
    }
}
